<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  

  <div id='app'></div>
  <button id="btn">点我</button>
  <script src="./kkb-vue3.js"></script>
  <script>
    const root = document.querySelector('#app')
    const btn = document.querySelector('#btn')

    const obj = reactive({
      name:'开课吧',
      age:6
    })
    let double = computed(()=> obj.age *2)
    effect(()=>{
      root.innerHTML = `<h1>${obj.name}今年${obj.age}岁了，乘以2是${double.value}</h1>`
    })
    btn.addEventListener('click', ()=>{
      obj.age += 1
    }, false)
  </script>
</body>
</html>